<?php

include "include/function_library.php";

$id = get ( "id" );

$delete_hotels_of_tour_query = "delete from hotel_of_tour where tour_id = $id";
$delete_transportation_of_tour_query = "delete from transportation_of_tour where tour_id = $id";
$query = "delete from tour where id = $id";

$result = sql_query($delete_hotels_of_tour_query);
$result = sql_query($delete_transportation_of_tour_query);
$result = sql_query ( $query );

if($result) redirect ( "tour_list.php?deleted=1" );
else redirect ( "tour_detail.php?deleted=0&id=".$id );
?>